package com.program.beautymakeup.controller;

import com.program.beautymakeup.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author bytedance
 * @ClassName UploadController.java
 * @Description TODO
 * @createTime 2023年02月07日 00:10:00
 */
@RestController
@RequestMapping("/upload")
public class UploadController {
    @Autowired
    private UploadService uploadService;

    @PostMapping("/uploadImg")
    public Object uploadImg(List<MultipartFile>fileList, HttpServletRequest request){
//        List<MultipartFile> fileList = List.of(file);
        String imgURL=uploadService.uploadImg(fileList,request);
        return imgURL;
    }
}

